from small one page howto to huge articles all in one place
 

search text in:





Poll
Which linux distribution do you use?







poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

195646

userrating:

average rating: 1.7 (102 votes) (1=very good 6=terrible)


May 25th. 2007:
Words

486

Views

252053

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

140917

userrating:

average rating: 1.4 (42 votes) (1=very good 6=terrible)


April, 26th. 2006:

Druckversion . pdf icon
You are here: System->Tips and Tricks

Killing Processes

This tip shows you some interesting ways to kill stubborn processes. Never let it be said that you can't kill a process again! The first way is the old boring way that most people probably use. Use the command ps aux, look through the process list until you find the PID you want and issue the kill command. How tedious!

Alternatively, try using the killall command which will automatically kill a program based on its name.

Code Listing 1

# killall mozilla-bin

But what if you only know part of the name? Well, you could combine ps with grep, kill and awk to produce something like this.

Code Listing 2

# ps aux | grep mozilla | awk '{print $2}' | xargs kill

But, there's a far simpler way. Enter pkill and the closely related pgrep. These commands are part of the sys-apps/procps package and are designed to search for (or kill) running processes. So the previous command could be replaced with the following:

Code Listing 3

# pkill mozilla

Note: To list the PIDs instead of killing them, use pgrep.

Finally, what if you have a runaway process hogging /dev/dsp, or some other file/socket? You can use fuser, which displays the PIDs of process using a specified file or filesystem. Or give it the -k option, like this, and you can easily kill those processes:

Code Listing 4

# fuser -k /dev/dsp

From http://www.gentoo.org/news/en/gwn/20030707-newsletter.xml


rate this article:
current rating: average rating: 1.3 (178 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 111.1 ms